package o;

import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appgallery.serverreqkit.api.listener.IServerCallBack;
import com.huawei.gamebox.framework.cardkit.bean.WiseJointDetailResponse;
import com.huawei.gamebox.plugin.gameservice.bean.GameInfo;
import o.bfx.b;

public class faa implements IServerCallBack {
    private GameInfo ˋ;
    private a ˏ;

    public interface a {
        void ˎ(Boolean bool);
    }

    public faa(@NonNull GameInfo gameInfo) {
        this.ˋ = gameInfo;
    }

    public void ˎ(a aVar) {
        this.ˏ = aVar;
    }

    public void ॱ() {
        bfx o_bfx = new bfx(this.ˋ);
        o_bfx.ˎ(new b(this) {
            final /* synthetic */ faa ˎ;

            {
                this.ˎ = r1;
            }

            public void ˋ(boolean z) {
                if (z) {
                    ezo ˋ = ezs.ˏ().ˋ(this.ˎ.ˋ);
                    if (ˋ == null) {
                        Logger.ˋ("PreloadDirector", "preloaded failed, for entry info being null");
                        this.ˎ.ˋ();
                        return;
                    }
                    if (TextUtils.isEmpty(this.ˎ.ˋ.getAppId())) {
                        this.ˎ.ˋ.setAppId(ˋ.ˊ());
                    }
                    bgl ʼ = ˋ.ʼ();
                    if (ʼ == null) {
                        Logger.ˋ("PreloadDirector", "preload interrupted, for home tab being null");
                        this.ˎ.ˎ();
                        return;
                    }
                    cvt ͺ = new eyi.b(ʼ.ˎ(), -1).ˊ(25).ͺ();
                    ͺ.setCacheID(ͺ.getCacheID());
                    ͺ.ˊ(0);
                    ͺ.ˊ(this.ˎ.ˋ.getAppId());
                    ͺ.ˏ(this.ˎ.ˋ.getPackageName());
                    ͺ.setRequestType(o.cvu.RequestStrategy.ˊ);
                    cfw.ˎ(ͺ, this.ˎ);
                    return;
                }
                Logger.ˋ("PreloadDirector", "preloaded failed, for entry info response error");
                this.ˎ.ˋ();
            }
        });
        o_bfx.ˏ();
    }

    public void prePostResult(BaseRequest o_cvu, ResponseBean responseBean) {
    }

    public void notifyResult(BaseRequest o_cvu, ResponseBean responseBean) {
        if (this.ˏ != null) {
            this.ˏ.ˎ(Boolean.valueOf(ezs.ˏ().ˋ(this.ˋ) != null));
        }
        if (responseBean instanceof WiseJointDetailResponse) {
            ezs.ˏ().ॱ(this.ˋ, o_cvu, responseBean);
        }
    }

    private void ˋ() {
        if (this.ˏ != null) {
            this.ˏ.ˎ(Boolean.valueOf(false));
        }
    }

    private void ˎ() {
        if (this.ˏ != null) {
            this.ˏ.ˎ(Boolean.valueOf(true));
        }
    }
}
